<?php

namespace App\Http\Controllers;

use App\Helpers\ApiResponse;
use App\Helpers\VerifyRequestInput;
use Dingo\Api\Routing\Helpers;
use Illuminate\Http\JsonResponse;

class BaseController extends Controller
{
    use Helpers;

    // API接口响应
    use ApiResponse;

    // 验证表单参数输入请求
    use VerifyRequestInput;

    /**
     * Get the token array structure.
     * @param string $token
     * @return string
     */
    protected function respondWithToken(string $token)
    {
        return 'Bearer '.$token;
    }

    // 生成订单号
    public function createOrderNo(): string
    {
        return 'ST'.time().rand(111111111111, 999999999999);
    }
}
